package cn.appsys.dao.appinfo;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.appsys.pojo.AppInfo;

/**
 * app维护接口
 * 
 * @author chenglong
 *
 */
public interface AppInfoMapper {

	/**
	 * 查询app列表
	 * 
	 * @author chenglong
	 * @param querySoftwareName
	 * @param queryStatus
	 * @param queryCategoryLevel1
	 * @param queryCategoryLevel2
	 * @param queryCategoryLevel3
	 * @param queryFlatformId
	 * @param devId
	 * @param currentPageNo
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<AppInfo> getAppInfoList(@Param(value = "softwareName") String querySoftwareName,
			@Param(value = "status") Integer queryStatus, @Param(value = "categoryLevel1") Integer queryCategoryLevel1,
			@Param(value = "categoryLevel2") Integer queryCategoryLevel2,
			@Param(value = "categoryLevel3") Integer queryCategoryLevel3,
			@Param(value = "flatformId") Integer queryFlatformId, @Param(value = "devId") Integer devId,
			@Param(value = "from") Integer currentPageNo, @Param(value = "pageSize") Integer pageSize) throws Exception;

	/**
	 * 根据条件查询appInfo表记录数
	 * 
	 * @author chenglong
	 * @param querySoftwareName
	 * @param queryStatus
	 * @param queryCategoryLevel1
	 * @param queryCategoryLevel2
	 * @param queryCategoryLevel3
	 * @param queryFlatformId
	 * @param devId
	 * @return
	 * @throws Exception
	 */
	public int getAppInfoCount(@Param(value = "softwareName") String querySoftwareName,
			@Param(value = "status") Integer queryStatus, @Param(value = "categoryLevel1") Integer queryCategoryLevel1,
			@Param(value = "categoryLevel2") Integer queryCategoryLevel2,
			@Param(value = "categoryLevel3") Integer queryCategoryLevel3,
			@Param(value = "flatformId") Integer queryFlatformId, @Param(value = "devId") Integer devId)
			throws Exception;

	/**
	 * @author chenglong
	 * @param AppInfo
	 * @return
	 * @throws Exception
	 */
	public boolean addAppInfo(AppInfo appinfo) throws Exception;

	/**
	 * 修改appinfo审核状态
	 */
	int updateAppStatus(@Param("id") Integer id, @Param("status") Integer status,
			@Param("modifyByid") Integer modifyByid, @Param("modifyDate") Date date);

	/**
	 * 根据appinfoid删除信息
	 * 
	 * @author chenglong
	 * @param appinfoid
	 */
	public boolean delAppinfo(@Param("appinfoid") Integer appinfoid);

	public AppInfo getAppInfo(@Param("id") Integer id);

	/**
	 * 修改app信息
	 */
	int updateAppInfo(AppInfo appInfo);

	/**
	 * 根据appid获得app信息
	 */
	AppInfo getAppInfoById(@Param("id") Integer id);
	/**
	 * 修改app版本id  versionid
	 */
	int updateVersionId(@Param("appInfoId")Integer appInfoId,@Param("versionId")Integer versionId);
	
}
